package lanqiao;




import java.util.Iterator;
import java.util.Scanner;
import java.util.Vector;

import javax.xml.bind.ValidationException;

public class Demo1 {
	private static int getFibo(int x) {
		if (x==1||x==2) {
			return 1;
		}
		else{
			return getFibo(x - 1) + getFibo(x - 2);
		}
	}
	@SuppressWarnings("resource")
	public static void main(String[] args) throws InterruptedException{
		Scanner sca=new Scanner(System.in);
         Vector<String> vec=new Vector<String>();
         int arr2[]=new int[10];
         int z = 0;int c=0;
          for(;;) {
        	  String x ;z++;
        	  if ((x=sca.nextLine()).equals('\n')) {
				arr2[c]=z;
				c++;
				z=0;
			} else {

			}
        	  vec.addElement(x);
        	  if (Integer.parseInt(x)==0) {
				break;
			}
          }
		vec.removeElement(vec.lastElement());
		int arr[]=new int[vec.size()];
		for (int i = 0; i < vec.size(); i++) {
			//System.out.println(vec.get(i));
			arr[i]=getFibo(Integer.parseInt(vec.get(i)));
		}
	   for (int i = 0; i < arr.length; i++) {
		System.out.print(arr[i]+" ");
	}
	   System.out.println(arr2[0]);
		
	}

}
